<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 10254
  Date: 2021/3/19
  Time: 18:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<head>
    <title>商店</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>

<body>
<div class="top">
    <span>嗨，欢迎来到UL商铺</span>
    <span class="top1">
            <c:if test="${empty sessionScope.state}">
                <button onclick="window.location.href='login.jsp'">登录</button>
                <button onclick="window.location.href='register.jsp'">注册</button>
            </c:if>
            <c:if test="${sessionScope.state!=null}">
                <span>欢迎您：${sessionScope.user.name}</span>
                <a onclick="window.location.href='/logout'">注销</a>
                <a onclick="window.location.href='/showcar'">我的购物车</a>
            </c:if>
        </span>
</div>
<table align="center" cellpadding="10" cellspacing="2" width="1200" height="600">
    <c:forEach items="${requestScope.goodsList}" var="goods" varStatus="status">
        <%--每四个一行--%>
        <c:if test="${status.count%4==1}">
            <tr>
        </c:if>
        <c:if test="${status.count%9==1}">
            <c:if test="${status.count/9<1}">
                <td rowspan="2">
                    <img src="/images/9.jpg" width="250" height="635"/>
                </td>
            </c:if>
            <c:if test="${status.count/9>1 && status.count/9>1<2}">
                <td rowspan="2">
                    <img src="/images/18.jpg" width="250" height="635"/>
                </td>
            </c:if>
            <c:if test="${status.count/9>2&&status.count/9<3}">
                <td rowspan="2">
                    <img src="/images/27.jpg" width="250" height="635"/>
                </td>
            </c:if>
        </c:if>
        <td>
            <a href="/detail/${goods.goods_id}" class="link1">
                <img src="/images/${goods.goods_image}" width="200" height="250"/>
                <div class="name">${goods.goods_name}</div>
                <span class="link1">${goods.goods_price}</span>
                <form action="/buy">
                    <input type="hidden" name="path" value="1">
                    <input type="submit" value="购买">
                </form>



                <a href="/pushcar?goodId=${goods.goods_id}" class="link2">加入购物车</a>
                <div class="name">${goods.goods_desc}</div>
                <span></span>
            </a>
        </td>
        <c:if test="${status.count%4==0}">
            </tr>
        </c:if>
    </c:forEach>
</table>

<div class="bottom">
    <a href="#">关于商铺</a>
    <a href="#">联系我们</a>
    <a href="#">官方合作</a>
    <a href="#">法律声明</a>
    <a href="#">知识产权</a>
    <hr>
    <span class="banquan">©2021-2121 FDLMF.COM 版权所有</span>
</div>


</body>

</html>